package com.exam.online.system.dao;

import com.exam.online.system.entity.Paper;
import com.exam.online.system.util.PageModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PaperDAO {
    int deleteByPrimaryKey(Integer id);

    int insert(Paper record);

    int insertSelective(Paper record);

    Paper selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Paper record);

    int updateByPrimaryKey(Paper record);

    @Select("select * from `t_paper` where teacher_id = #{teacherId} limit #{pageNo},#{pageSize}")
    List<Paper> selectByTeacherId(@Param("teacherId") Integer teacherId, @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    @Select("select count(*) from `t_paper` where teacher_id = #{teacherId}")
    int totalByTeacherId(@Param("teacherId") Integer teacherId);
}